package com.shoulei.designpattern.abstractFactoryPattern;

import javax.swing.plaf.synth.ColorType;

/**
 * @ClassName:ColorFactory
 * @Descrition:
 * @Author:shoulei
 * @Date:2019/3/31 17:11
 * @Verson:
 */
public class ColorFactory extends AbstractFactory{
    @Override
    Color getColor(String colorType) {
        if(colorType == null){
            return null;
        }
        if(colorType.equalsIgnoreCase("red")){
            return (Color) new Red();
        }else if(colorType.equalsIgnoreCase("blue")){
            return (Color) new Blue();
        }else if(colorType.equalsIgnoreCase("green")){
            return (Color) new Green();
        }
        return null;
    }

    @Override
    Shape getShape(String shape) {
        return null;
    }
}
